package com.ly.mapper;

import com.ly.bean.EasybuyOrder;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
@author 李岩
@date 2021/12/14-13:52
@describe
*/
@Mapper
public interface EasybuyOrderMapper {
    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id) throws Exception;

    /**
     * 添加订单
     */
    int insert(EasybuyOrder record) throws Exception;

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(EasybuyOrder record) throws Exception;

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    EasybuyOrder selectByPrimaryKey(Integer id) throws Exception;

    //根据登录的用户id获取该用户的订单信息
    List<EasybuyOrder> selectOrderByUserId(Integer userId) throws Exception;

    //查询所有的订单信息
    List<EasybuyOrder> selectAllOrders() throws Exception;
    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(EasybuyOrder record) throws Exception;

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(EasybuyOrder record) throws Exception;
}